#include "TcpServer.hpp"
#include <memory>


void Useage(const std::string proc) 
{
    std::cout << "\n\rUseage: " << proc << " port[1024+]" << std::endl;
}
//./tcpserver port


int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Useage(argv[0]);
        exit(0);
    }
    // 字符串端口转整形
    uint16_t port = std::stoi(argv[1]);
    lg.Enable(Classfile);
    
    std::unique_ptr<TcpServer> tc(new TcpServer(port));

    tc->InitServer();
    tc->Start();
    return 0;
}